import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)

//路由
import router from './router'

//状态管理
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const store = createPinia()
store.use(piniaPluginPersistedstate)

//icon图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
import 'element-plus/theme-chalk/index.css'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'


//国际化
import i18n from './locales'

//全局混入
import useDicts from '@mixins/DIctsPlugin'


//自定义指令
import { AuthDirectives } from './directives/auths.directives'

app.use(router)
app.use(store)
app.use(i18n)
app.use(ElementPlus, {
  locale: zhCn,
})

app.directive(AuthDirectives.name, AuthDirectives)
app.use(useDicts)
app.mount('#app')